<%= form_for(@product) do |f| %>
  <% if @product.errors.any? %>
    <div id="error_explanation">
      <h2>啥玩意儿这是，<%= @product.errors.count %>处有错，差评！</h2>

      <ul>
      <% @product.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :title,"标题" %><br>
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :description,"描述" %><br>
    <%= f.text_area :description, :rows => 6 %>
  </div>
  <div class="field">
    <%= f.label :image_url，,"图片路径" %><br>
    <%= f.text_field :image_url %>
  </div>
  <div class="field">
    <%= f.label :price,"价格" %><br>
    <%= f.text_field :price %>
  </div>
  <div class="actions">
    <%= f.submit '确定'%>
  </div>
<% end %>
